package daobeauty.proxy.javassist;

import java.lang.reflect.Method;

import javassist.util.proxy.MethodHandler;
import daobeauty.interceptor.MethodInterceptor;

/**
 * Created 09.09.2008
 * @author M. Serhat Cinar
 *
 */
public class MethodHandlerAdapter implements MethodHandler {
	private MethodInterceptor generalInterceptor;
	
	public MethodHandlerAdapter(MethodInterceptor generalInterceptor){
		this.generalInterceptor = generalInterceptor;
	}
	
	/* (non-Javadoc)
	 * @see javassist.util.proxy.MethodHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.reflect.Method, java.lang.Object[])
	 */
	@SuppressWarnings("unused")
	public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable {
		return generalInterceptor.invoke(thisMethod, args);
	}

}
